refactor(dfn-index): remove no-op toc subscription; improve comment#5216
refactor(dfn-index): remove no-op toc subscription; improve comment#5216marcoscaceres wants to merge 5 commits intomainfrom
Conversation
When #index is absent, dfn-index was subscribing to the "toc" event with an empty callback. The EventTarget-based pubsub doesn't require listeners, so this subscription had no effect. Remove it. Also rewrite the XXX comment on the real "toc" subscription to explain the ordering pattern more clearly.
There was a problem hiding this comment.
Pull request overview
Removes an unnecessary no-op "toc" subscription in core/dfn-index and clarifies the rationale for subscribing to the real "toc" event used to append section numbers once core/structure has run.
Changes:
- Drop the dead
sub("toc", () => {}, { once: true })from the#index-missing early return path. - Rewrite the
"toc"subscription comment to explain the ordering dependency withcore/structure.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
Summary
sub("toc", () => {}, { once: true })from the early-return path ofdfn-index.run(). TheEventTarget-based pubsub doesn't require listeners, so this subscription had no observable effect.XXXcomment on the real"toc"subscription (used to runappendSectionNumbersaftercore/structureassigns section numbers) to explain the ordering pattern clearly.Test plan
pnpm start --browser ChromeHeadless --grep="Core - Dfn Index"